yzm_onload=function(){
	let xml;
	if (window.XMLHttpRequest)
	{
	    //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
	    xml=new XMLHttpRequest();
	}
	else
	{
	    // IE6, IE5 浏览器执行代码
	    xml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xml.onreadystatechange=function(){
		if(xml.readyState==4&&xml.status==200){
		let text=JSON.parse(xml.responseText);
		let yzm=document.getElementById("yzm_in");
		yzm.innerHTML=text.data;
		}
	}
	xml.open("POST","/user/getCheckCode",true);
	xml.send();
}
getmessame=function(){
	let xml;
	if (window.XMLHttpRequest)
	{
	    //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
	    xml=new XMLHttpRequest();
	}
	else
	{
	    // IE6, IE5 浏览器执行代码
	    xml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xml.onreadystatechange=function(){
		if(xml.readyState==4&&xml.status==200){
		let text=JSON.parse(xml.responseText);
		if(text.data!=""&&text.data!=null){
			alert(text);
		}
		}
	}
	xml.open("get","/user/CheckUser",true);
	xml.send();
}
zc_onclick=function(){
	let email=document.getElementById("su_user");
	let pas1=document.getElementById("su_pass1").value;
	let pas2=document.getElementById("su_pass2").value;
	if(pas1!=pas2)
	{
		alert("请输入相同两次密码");
		return;
	}
	let xml;
	if (window.XMLHttpRequest)
	{
	    //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
	    xml=new XMLHttpRequest();
	}
	else
	{
	    // IE6, IE5 浏览器执行代码
	    xml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xml.onreadystatechange=function(){
		if(xml.readyState==4&&xml.status==200){

		let text=JSON.parse(xml.responseText);
		alert(text.data);
		}
	}
	let password=document.getElementById("su_pass1");
	xml.open("post","/user/addUser",true);
	xml.setRequestHeader('content-type','application/x-www-form-urlencoded');
	xml.send('uPassword='+password.value+'&uName='+email.value);
}
function IsEmail(str) {
 	let reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
    return  reg.test(str);
 }
